#coding=utf-8
from django.db import models

# Create your models here.


class Proxy(models.Model):
    STATUS_CHOICES = (
        (0, '未检测'),
        (1, '可用'),
        (301, '301'),
        (400, '400'),
        (403, '403'),
        (404, '404'),
        (407, '407'),
        (500, '500'),
        (502, '502'),
        (503, '503'),
        (504, '504'),
        (2, '520'),
        (9, '不可用'),
    )

    Ip = models.CharField(max_length=15, verbose_name=u'IP', null=True,)
    Port = models.IntegerField(verbose_name=u'Port', null=True)
    Status = models.IntegerField(verbose_name=u'可用', default=0, choices=STATUS_CHOICES)
    CreateTime = models.DateTimeField(verbose_name='CreateTime', auto_now_add=True)
    UpdateTime = models.DateTimeField(verbose_name="UpdateTime", auto_now=True, null=True)
    CheckErrTimes = models.IntegerField(verbose_name=u'连续不可用次数', null=True, default=0)

